package com.fbt.transfer.app.driver.model;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * 订单类型
 *
 * @author tuocoo
 * @date 2025/3/22/21:46
 */
@Getter
public enum OrderTypeEnum {
  /** 订单类型，接机 */
  PICK_UP("PICK_UP", "接机"),

  DROP_OFF("DROP_OFF", "送机"),
  UNKNOWN("DROP_OFF", "未知"),
  ;

  @JsonValue private final String value;

  private final String desc;

  OrderTypeEnum(String value, String desc) {
    this.value = value;
    this.desc = desc;
  }

  public static OrderTypeEnum getByValue(String value) {
    for (OrderTypeEnum orderTypeEnum : OrderTypeEnum.values()) {
      if (orderTypeEnum.getValue().equals(value)) {
        return orderTypeEnum;
      }
    }
    return UNKNOWN;
  }
}
